import QtQuick 2.0
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import  Quick.UIComponent.Text.Normal  0.1


Item {
    id:root
    property int pxSize
    property string fontFamily
    property bool bold
    property int pt
    property string text
    implicitHeight: pxSize
    implicitWidth: pxSize*text.length


    MText{
        id:txt
        color: "white"
        pxSize:root.pxSize
        text:root.text
        fontFamily:root.fontFamily
        visible: false
    }

    MText{
        text:root.text
        color: "gray"
        pxSize:root.pxSize
        opacity: 0.5
        fontFamily:root.fontFamily
    }


    OpacityMask {
        id: effect
        width: txt.contentWidth;
        height: txt.contentHeight
        source: txt
        maskSource: gradient
    }

    RadialGradient {
        id: gradient
        visible: false
        width: txt.contentWidth;
        height: txt.contentHeight
        horizontalRadius: width/2
        verticalRadius: height*4/5
        horizontalOffset: 0
        gradient: Gradient{
            GradientStop{position: 0.2; color:'white'}
            GradientStop{position: 0.8; color:'transparent'}
        }

        PropertyAnimation{
            target: gradient
            properties: 'horizontalOffset'
            from: -gradient.width
            to: gradient.width + gradient.horizontalRadius
            duration: 2000
            running: true
            loops: -1
        }
    }

}
